<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmDataEntryTable extends Migration
{
    /**
     * Run the migrations.
     *员工每天工作内容记录
     * @return void
     */
    public function up()
    {
        //
        Schema::create('crm_data_entry', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->comment='crm 员工每天工作内容记录';
            $table->increments('id')->comment('自增键');
            $table->integer('crm_uid')->index('crm_uid')->unsigned()->default(0)->comment('crmUid');
            $table->date('date')->index('date')->comment('时间');
            $table->integer('minutes_num')->default(0)->comment('员工当天的通话分钟数');
            $table->integer('phone_num')->unsigned()->default(0)->comment('员工当天电话通数');
            $table->integer('visit_num')->unsigned()->default(0)->comment('员工当天拜访客户数');
            $table->unique(['crm_uid','date']);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('crm_data_entry');
    }
}
